package com.pansky.crm.mapper.mysql;

import com.pansky.crm.common.mybatisplus.SuperMapper;
import com.pansky.crm.entity.Privilege;
import com.pansky.crm.entity.RolePrivilege;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author ：zhouzhiyong
 * @date ：Created in 2021/2/22 10:35
 * @description：权限mapper
 */
@Mapper
public interface RolePrivilegeMapper extends SuperMapper<RolePrivilege> {

    List<Privilege> listPrivilegeByRoleId(@Param("roleId") Long roleId);

    Integer listPrivilegeByRoleId(@Param("roleId") Integer roleId, @Param("privilegeKeyList") List<String> privilegeKeyList);

    Integer batchSaveRolePrivilegeByPrivilegeKeys(@Param("roleId") Integer roleId, @Param("privilegeKeys") List<String> privilegeKeys);
}
